import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter);

//引入组件
import home from "../components/home.vue"
import member from "../components/member.vue"
import shopcar from "../components/car/shopcar.vue"
import search from "../components/search.vue"
import newList from '../components/news/newList.vue'
import newsInfo from "../components/news/newsInfo.vue"
import shareImg from "../components/photoShare/shareImg.vue"
import photoinfo from "../components/photoShare/photoinfo.vue"
import goodsList from "../components/goodslist/goodsList.vue"
import goodsInfo from "../components/goodslist/goodsInfo.vue"
import details from "../components/goodslist/details.vue"
import goodsCom from "../components/goodslist/goodsCom.vue"

const router = new VueRouter({
  
    linkActiveClass:"active",
    routes: [
        {
            path:"/",
            redirect:"/home"
        },
        {
            path:"/home",
            component: home
        },
        {
            path:"/member",
            component: member
        },
        {
            path:"/shopcar",
            component: shopcar
        },
        {
            path:"/search",
            component: search
        },
        {
            path:"/news",
            component:newList,
        },
        {
            path:"/news&:id",
            component: newsInfo
        },
        {
            path:"/shareImg",
            component: shareImg
        },
        {
            path: "/shareImg/:id",
            component: photoinfo
        },
        {
            path: "/buy",
            component: goodsList
        },
        {
            path: "/goodsInfo/:id",
            component: goodsInfo
        },
        {
            path:"/introduce",
            component:details
        },
        {
            path:"/goodsCom",
            component:goodsCom
        }
    ]
})

export default router